<template>
  <Teleport to=".header">
    <van-nav-bar title="title">
      <template #left>
        <slot name="left"></slot>
      </template>
      <template #title>

        <slot name="title">{{title}}</slot>
      </template>
      <template #right>
        <slot name="right"></slot>
      </template>
    </van-nav-bar>
  </Teleport>
</template>

<script setup lang="ts">
import { defineProps } from 'vue';


interface MyTopBar {
  title: string,
  back?: boolean

}
// 接收父组件传过来的数据
defineProps<MyTopBar>()

 

</script>
<style scoped lang="scss">
@import '@/styles/variable.scss';

:deep(.van-nav-bar__content) { 
  background-color: $globalColor;
}

</style>